if(CMAKE_CXX_COMPILER_ID MATCHES Clang OR CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES AppleClang)
    check_cxx_compiler_flag(-mavx512bf16 COMPILER_SUPPORTS_AVX512_BF16)
    if (COMPILER_SUPPORTS_AVX512_BF16)
        set_property(SOURCE ex19_test.cpp APPEND PROPERTY COMPILE_OPTIONS "-DCOMPILER_SUPPORTS_AVX512_BF16")
        set_property(SOURCE bf16_conv.c APPEND PROPERTY COMPILE_OPTIONS "-mavx512f")
	set_property(SOURCE bf16_conv.c APPEND PROPERTY COMPILE_OPTIONS "-mavx512bf16")
	set_property(SOURCE bf16_conv.c APPEND PROPERTY COMPILE_OPTIONS "-flax-vector-conversions")
	set(amx_ex19_srcs bf16_conv.c)
    endif()
else()
    set_property(SOURCE ex19_test.cpp APPEND PROPERTY COMPILE_OPTIONS "/DCOMPILER_SUPPORTS_AVX512_BF16")
    set(amx_ex19_srcs bf16_conv.c)
endif()
add_executable(amx_ex19_tests ${amx_ex19_srcs} ex19_test.cpp)
target_link_libraries(amx_ex19_tests gtest_main optimisation_common)
add_test(NAME amx_ex19_test COMMAND amx_ex19_tests)
